<template>
	<view class="container">
		<u-navbar title="问题解答" background="url('https://www.yplm888.com//uploads/20220803/7ed305f9a93ba50b049a7725662b18cc.png') no-repeat"></u-navbar>
		<view class="content-text">
			<scroll-view class="text" :scroll-y="true" :style="'height:' + scrollH+'rpx;'">
				<u-parse :html="content"></u-parse>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: '',
				id: '',
				scrollH: 0,
				height: 200,
			}
		},
		mounted() {
			let that = this;
			uni.getSystemInfo({
				success: function(res) {
					that.scrollH = res.windowHeight * 750 / res.windowWidth;
					// #ifdef MP-WEIXIN
					that.scrollH = res.windowHeight * 750 / res.windowWidth - parseInt(res.safeArea.top) - that
						.height;
					// #endif
				}
			});
		},
		onLoad(option) {
			this.id = option.id
			this.getQuestionDetail(option.id)
			uni.setNavigationBarTitle({
				title: option.title
			})
			
		},
		methods: {
			getQuestionDetail(id) {
				this.$u.api.QuestionDetail({id:id}).then(res => {
					console.log('aaaaa',res.data)
					this.content = res.data.content
				})
			}
		}
	}
</script>

<style>
	.container{
		overflow-x: hidden;
		position: relative;
	}
	.content-text {
		margin: 40rpx;
		margin-top: 0rpx;
	}
</style>
